# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-requests-futures
pkgname=('python2-requests-futures' 'python-requests-futures')
_pkgname=requests-futures
pkgver=1.0.2
pkgrel=1
pkgdesc='Asynchronous Python HTTP for Humans.'
arch=('any')
url='https://pypi.org/project/requests-futures/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('1d163ffe45a09e0160710cf8bd060f741a524e60d69318af7c03a3b5dc41f27f4f7d115faed227bb710b29ffdb230a7ef5991e33ab2ad4e25b3c52727ef76fc7')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-requests-futures() {
  depends=('python2' 'python2-requests' 'python2-futures')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-requests-futures() {
  depends=('python' 'python-requests' 'python2-futures')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

